package it.polito.connectedcar.network;

import java.net.InetAddress;
import java.util.Comparator;

public class Neighbor implements Comparator<Neighbor>{

	private InetAddress address;
	private int port;
	private double longitudePosition;
	private double latitudePosition;
	
	private float speed; // in KM/h
	private double distance; // in meters
	private float direction; // in degrees
	
	
	public InetAddress getAddress() {
		return address;
	}

	public void setAddress(InetAddress address) {
		this.address = address;
	}

	public double getLongitudePosition() {
		return longitudePosition;
	}

	public void setLongitudePosition(double longitudePosition) {
		this.longitudePosition = longitudePosition;
	}

	public double getLatitudePosition() {
		return latitudePosition;
	}

	public void setLatitudePosition(double latitudePosition) {
		this.latitudePosition = latitudePosition;
	}

	public float getSpeed() {
		return speed;
	}

	public void setSpeed(float speed) {
		this.speed = speed;
	}

	public double getDistance() {
		return distance;
	}

	public void setDistance(double distance) {
		this.distance = distance;
	}

	public float getDirection() {
		return direction;
	}

	public void setDirection(float direction) {
		this.direction = direction;
	}

	@Override
	public int compare(Neighbor arg0, Neighbor arg1) {
		return (int) (arg1.getDistance()-arg0.getDistance());
	}

	public int getPort() {
		return port;
	}

	public void setPort(int port) {
		this.port = port;
	}
	
	
}
